package com.itheima;

import com.itheima.mapper.ClassMapper;
import com.itheima.pojo.Class;
import com.itheima.pojo.Student;
import org.junit.jupiter.api.Test;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.autoconfigure.graphql.tester.AutoConfigureGraphQlTester;
import org.springframework.boot.test.context.SpringBootTest;

import java.util.List;

@SpringBootTest
public class shiyan5 {
    @Autowired
    private ClassMapper classMapper;
    @Test
    public  void test(){
        List<Class> list = classMapper.list();
        System.out.println(list);
    }

    @Test
    public void  test2(){
        Student student=new Student();
        student.setName("小小博");
        List<Student> st=classMapper.listStudentsStudents(student);
        System.out.println("一个条件的查询结果");
        System.out.println(st);
        student.setAge(4334);
        System.out.println("两个条件的查询结果");
        List<Student> students = classMapper.listStudentsStudents(student);
        System.out.println(students);
    }
    @Test
    public void test3(){
        Student student=new Student();
        student.setName("小小然");
        Student condition=new Student();
        condition.setCode("32323");
        classMapper.updateStudent(student,condition);
    }
}
